package org.jeese.common.shiro;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

public class ShiroPasswordHelper {
    //private RandomNumberGenerator randomNumberGenerator = new SecureRandomNumberGenerator();
    private String algorithmName = "md5";
    private int hashIterations = 2;

    public void encryptPassword(String account,String password) {
		String newPassword = new SimpleHash(algorithmName, password, ByteSource.Util.bytes(account), hashIterations).toHex();
        System.out.println(newPassword);

    }
    public static void main(String[] args) {
        ShiroPasswordHelper passwordHelper = new ShiroPasswordHelper();
        passwordHelper.encryptPassword("admin","1");
        
    }
}
